$(document).ready(function () {
    $("#filtform").on("click",function () {
        var stock=null;
        if($("#stock").checked==true)
        {
            stock=$("#stock").val();
        }
        var lprice=$("#lprice").val();
        var hprice=$("#hprice").val();
        var searchStr=$("#searchStr").val();
        var type=$("#type").val();
        var url="/commodity/Search?commType="+type+"&searchString="+searchStr+"&commStock="+stock
            +"&priceLowerBound="+lprice+"&priceUpperBound="+hprice;
        $("#filtform").attr('action',url);
    })
});